#ifndef SETTINGS_H
#define SETTINGS_H

#include <QtCore>

class QCMSettings : public QObject
{
    Q_OBJECT;
public:
    QCMSettings(const QString& path);
    QCMSettings();
    ~QCMSettings();

    static void InstallSettings(QCMSettings* settings);
    static QCMSettings* Current();

    static QString DefaultSettingsPath();

    void Set(const QString& aKey, const QString& aValue);
    QString Get(const QString& aKey, const QString& aDefaultValue = QString::null);

    bool Store();
    bool Load();

    void setStoreOnExit(bool aStore){ iStoreOnExit = aStore; }
    bool storeOnExit(){ return iStoreOnExit; }

    void setAutoStore(bool aStore){ iAutoStore = aStore; }
    bool autoStore(){ return iAutoStore; }

private:
    QMap<QString, QString> iSettingsMap;
    QString iSettingsPath;
    bool iStoreOnExit, iAutoStore;

};

#endif // SETTINGS_H
